package com.common.project.entity;

import cn.afterturn.easypoi.excel.annotation.Excel;
import cn.afterturn.easypoi.excel.annotation.ExcelTarget;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;

import java.io.Serializable;
import java.util.Date;

@Data
@EqualsAndHashCode(callSuper = true)
@Accessors(chain = true)
@ApiModel(value="log对象", description="日志表")
@ExcelTarget("log")
@NoArgsConstructor
@AllArgsConstructor
public class Log extends Model<com.common.project.table.Log > {
    private static final long serialVersionUID = 1L;

    @TableId(value = "id", type = IdType.ID_WORKER)
    private Long id;

    @Excel(name = "日志描述",replace = {"_null"},width = 15.0)
    @ApiModelProperty(value = "日志描述")
    private String description;

    @Excel(name = "异常详细信息",replace = {"_null"},width = 15.0)
    @ApiModelProperty(value = "异常详细信息")
    private String exceptionDetail;

    @Excel(name = "异常类型",replace = {"_null"},width = 15.0)
    @ApiModelProperty(value = "异常类型")
    private String logType;

    @Excel(name = "异常方法",replace = {"_null"},width = 15.0)
    @ApiModelProperty(value = "异常方法")
    private String method;

    @Excel(name = "异常参数",replace = {"_null"},width = 15.0)
    @ApiModelProperty(value = "异常参数")
    private String params;

    @Excel(name = "访问IP",replace = {"_null"},width = 15.0)
    @ApiModelProperty(value = "访问IP")
    private String requestIp;

    @Excel(name = "耗时",replace = {"_null"},width = 15.0)
    @ApiModelProperty(value = "耗时")
    private String time;

    @Excel(name = "创建时间",replace = {"_null"},exportFormat = "yyyy-MM-dd",importFormat="yyyy/MM/dd",width = 15.0)
    @ApiModelProperty(value = "创建时间",example = "2019-07-01 00:00:00")
    @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
    private Date createTime;



    @Override
    protected Serializable pkVal() {
        return this.id;
    }
}
